package com.ldc.security;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @auther liudc
 * @since 2022/11/6
 */

@SpringBootTest
public class PassWordUnit {
    private final Logger logger = LoggerFactory.getLogger(PassWordUnit.class);

    @Test
    public void passwordTest() {
        PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        String s = passwordEncoder.encode("123456");
        logger.info("密码 = {}", s);
    }
}
